using System;
using System.Collections.Generic;
using MvcCms.Data;
using MvcCms.Data.Entities;
using System.Web.Mvc;

namespace MvcCms.Service
{
    public interface ICmsService
    {
        ModelStateDictionary GetModelStateDictionary();
        //Content Category Methods
        ContentCategory GetContentCategory(int catId);
        ContentCategory GetContentCategory(int id, string direction, bool issubcat);
        int CreateContentCategory(ContentCategory contentcategoryToCreate);
        bool CreateContentCategory(ContentCategory contentcategoryToCreate, Portal portal);

        IEnumerable<ContentCategory> ListCategories();
        IEnumerable<ContentCategory> BuildCategoryListForBackOffice(IEnumerable<ContentCategory> categories);
        IEnumerable<ContentCategory> ListAllCategories();
        IEnumerable<ContentCategory> ListAllCategoriesWithPages();
        IEnumerable<ContentCategory> ListCategoriesForBackOffice();
        IEnumerable<ContentCategory> ListTopNav();
        IEnumerable<DTOSubCategory> ListSubCategories(int catId);
        IList<ContentCategory> ListCategoriesHierarchy();

        bool EditContentCategory(ContentCategory categoryToEdit);
        bool EditContentCategoryNoValidation(ContentCategory categoryToEdit);
        bool DeleteContentCategory(ContentCategory categoryToDelete);

        bool SetPublishedPage(int contentPageId);

        //Content Page Methods
        ContentPage GetContentPageForRequest();
        ContentPage GetContentPage(int id);
        ContentPage GetContentPage(int id, string direction);
        DTOPage GetDTOContentPage(int id);
        ContentComment GetContentComment(int commentId);

        ContentPage GetPublishedCategoryContentPage(int catId);
        ContentPage GetPublishedSubCategoryContentPage(string path);
        DTOPage GetCurrentPageForCategory(int catId);
        ContentPage GetContentSubPageByPath(string path, int catid);
        DTOPage GetAltLanguagePage(int languageId, int parentPageId);
        ContentPage GetAltLanguagePageForCMS(string languagePathId, int parentPageId);

        int CreateContentPage(ContentPage contentpageToCreate);
        bool CreateContentComment(ContentComment contentcommentToCreate);

        IEnumerable<DTOContentPageForEditor> ListPages();
        IEnumerable<DTOContentPageForEditor> ListPages(Guid contributorId);
        IEnumerable<DTOComment> ListContentComments(int pageId);
        IEnumerable<ContentPage> ListCategoryPagesByCategory(int catId);
        IEnumerable<ContentPage> ListSubPages(int catId);
        IEnumerable<ContentPage> ListAltLanguagePages(int parentPageId);
        IEnumerable<DTOPage> ListPagesForCategory(int catId);
        IEnumerable<DTOPage> ListUnpublishedPagesForCategory(int catId);
        IEnumerable<ContentComment> ListContentComments(Guid userId);

        bool EditContentPage(ContentPage pageToEdit, string newTitle);
        bool EditContentPage(ContentPage pageToEdit);
        bool EditContentComment(ContentComment contentcommentToEdit);
        bool DeleteContentPage(ContentPage pageToDelete);
        bool DeleteContentComment(ContentComment commentToDelete);

        //Module Methods
        Module GetModule(int moduleId);
        WeightedContentModule GetNextWeightedModuleForTargetDiv(string targetDiv, bool isAuthenticated, string[] roles, int lastWeightedModuleId);
        WeightedContentWidget GetNextWeightedWidgetForTargetDiv(string targetDiv, bool isAuthenticated, string[] roles);
        WeightedContentWidget GetNextWeightedWidgetForZone(string zoneName, bool isAuthenticated, string[] roles);
        bool CreateModule(Module moduleToCreate);
        IEnumerable<Module> ListModules();
        IEnumerable<DTOModule> ListModulesForPage(int pageId);
        bool DeleteModule(int moduleId);
        bool EditModule(Module moduleToEdit);

        Widget GetWidget(int widgetId);
        bool CreateWidget(Widget widgetToCreate);
        IEnumerable<Widget> ListWidgets();
        IEnumerable<Widget> ListWidgetsForPage(int pageId);
        IEnumerable<Widget> ListWidgetsForZones();
        bool DeleteWidget(int widgetId);
        bool EditWidget(Widget widgetToEdit);

        WeightedContent GetWeightedContent(int weightedContentId);
        bool CreateWeightedContent(WeightedContent weightedContentToCreate);
        IEnumerable<WeightedContent> ListWeightedContents();
        IEnumerable<WeightedContentModule> ListWeightedContentModules();
        bool DeleteWeightedContent(int weightedContentId);
        bool EditWeightedContent(WeightedContent weightedContentToEdit);

        bool CreateRedirect(Redirect redirectToCreate);
        Redirect GetRedirect(string oldURL);
        Redirect GetGlobalRedirect(string oldURL);
        IEnumerable<Redirect> ListRedirects();
        bool EditRedirect(Redirect redirectToEdit);
    }
}